package dane.brown.sql.checker.service.config;

import dane.brown.sql.checker.service.model.CheckRule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
public class CheckRuleConfig {

    @Autowired
    private CheckRuleProperties checkRuleProperties;

    // 将规则列表注册为Spring Bean，供其他组件使用
    @Bean
    public List<CheckRule> checkRules() {
        return checkRuleProperties.getRule();
    }
}
